using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GoldDigger.Models;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using TPL.Xna.Common;

namespace GoldDigger.Screens
{
    internal class WelcomeScreen : InfoScreen
    {
        private readonly int _targetValue;
        private readonly int _level;

        public WelcomeScreen(Scene scene, int totalValue, int level)
            : base(4, new PlayScreen(scene, totalValue, level))
        {
            _targetValue = scene.TargetValue;
            _level = level;
        }

        public override void LoadContent()
        {
            // Common font
            var font = ScreenManager.Game.Content.Load<SpriteFont>(@"Fonts/MenuFont");

            if (_level != 1)
            {
                AddSprite(new TextSprite("Congratulations !!!")
                {
                    Position = new Vector2(200, 50),
                    Font = font,
                    Color = Color.Green,
                    Scale = 1.5f,
                });
                AddSprite(new TextSprite("You get enough money for next stage.")
                {
                    Position = new Vector2(100, 120),
                    Font = font,
                    Color = Color.Green,
                    Scale = 1f,
                });
            }
            else
            {
                AddSprite(new TextSprite("Good luck !!!")
                {
                    Position = new Vector2(300, 50),
                    Font = font,
                    Color = Color.Green,
                    Scale = 1.5f,
                });
            }

            AddSprite(new TextSprite("Next target")
            {
                Position = new Vector2(230, 150),
                Font = font,
                Color = Color.Yellow,
                Scale = 2f,
            });

            AddSprite(new TextSprite(_targetValue.ToString())
            {
                Position = new Vector2(350, 250),
                Font = font,
                Color = Color.Green,
                Scale = 1.5f,
            });

            base.LoadContent();
        }
    }
}
